package com.heather.exam.models;

//创建管理员类Admin，用于管理管理员的信息和权限
public class Admin {
    private String username;
    private String password;

    public Admin(String username) {
        this.username = username;
    }

    public Admin(String admin, String adminpass) {

    }

    // 冻结账户
    public void freezeAccount(Account account) {
        if (account.getRole().equals("管理员")) {
            System.out.println("管理员账户不能被冻结。");
        } else {
            account.freezeAccount();
        }
    }

    // 解冻账户
    public void unfreezeAccount(Account account) {
        account.unfreezeAccount();
    }
    public boolean authenticate(String username, String password) {
        return this.username.equals(username) && this.password.equals(password);
    }
    public void writeAnnouncement(String announcement) {
            System.out.println("Writing announcement: " + announcement);
            // 在这里可以将公告内容写入数据库或文件中
        }
}
//        private String username;
//        private String password;
//
//        public Admin(String username, String password) {
//            this.username = username;
//            this.password = password;
//        }
//

//
//




